3.4.30 \(\int \frac {x^2 (a+b \log (c x^n))}{d+\frac {e}{x}} \, dx\) [330]

Optimal. Leaf size=148 \[ \frac {a e^2 x}{d^3}-\frac {b e^2 n x}{d^3}+\frac {b e n x^2}{4 d^2}-\frac {b n x^3}{9 d}+\frac {b e^2 x \log \left (c x^n\right )}{d^3}-\frac {e x^2 \left (a+b \log \left (c x^n\right )\right )}{2 d^2}+\frac {x^3 \left (a+b \log \left (c x^n\right )\right )}{3 d}-\frac {e^3 \left (a+b \log \left (c x^n\right )\right ) \log \left (1+\frac {d x}{e}\right )}{d^4}-\frac {b e^3 n \text {Li}_2\left (-\frac {d x}{e}\right )}{d^4} \]

[Out]

a*e^2*x/d^3-b*e^2*n*x/d^3+1/4*b*e*n*x^2/d^2-1/9*b*n*x^3/d+b*e^2*x*ln(c*x^n)/d^3-1/2*e*x^2*(a+b*ln(c*x^n))/d^2+
1/3*x^3*(a+b*ln(c*x^n))/d-e^3*(a+b*ln(c*x^n))*ln(1+d*x/e)/d^4-b*e^3*n*polylog(2,-d*x/e)/d^4

________________________________________________________________________________________

Rubi [A]
time = 0.12, antiderivative size = 148, normalized size of antiderivative = 1.00, number of steps used = 8, number of rules used = 7, integrand size = 23, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.304, Rules used = {269, 45, 2393, 2332, 2341, 2354, 2438} \begin {gather*} -\frac {b e^3 n \text {PolyLog}\left (2,-\frac {d x}{e}\right )}{d^4}-\frac {e^3 \log \left (\frac {d x}{e}+1\right ) \left (a+b \log \left (c x^n\right )\right )}{d^4}-\frac {e x^2 \left (a+b \log \left (c x^n\right )\right )}{2 d^2}+\frac {x^3 \left (a+b \log \left (c x^n\right )\right )}{3 d}+\frac {a e^2 x}{d^3}+\frac {b e^2 x \log \left (c x^n\right )}{d^3}-\frac {b e^2 n x}{d^3}+\frac {b e n x^2}{4 d^2}-\frac {b n x^3}{9 d} \end {gather*}

Antiderivative was successfully verified.

[In]

Int[(x^2*(a + b*Log[c*x^n]))/(d + e/x),x]

[Out]

(a*e^2*x)/d^3 - (b*e^2*n*x)/d^3 + (b*e*n*x^2)/(4*d^2) - (b*n*x^3)/(9*d) + (b*e^2*x*Log[c*x^n])/d^3 - (e*x^2*(a
 + b*Log[c*x^n]))/(2*d^2) + (x^3*(a + b*Log[c*x^n]))/(3*d) - (e^3*(a + b*Log[c*x^n])*Log[1 + (d*x)/e])/d^4 - (
b*e^3*n*PolyLog[2, -((d*x)/e)])/d^4

Rule 45

Int[((a_.) + (b_.)*(x_))^(m_.)*((c_.) + (d_.)*(x_))^(n_.), x_Symbol] :> Int[ExpandIntegrand[(a + b*x)^m*(c + d
*x)^n, x], x] /; FreeQ[{a, b, c, d, n}, x] && NeQ[b*c - a*d, 0] && IGtQ[m, 0] && ( !IntegerQ[n] || (EqQ[c, 0]
&& LeQ[7*m + 4*n + 4, 0]) || LtQ[9*m + 5*(n + 1), 0] || GtQ[m + n + 2, 0])

Rule 269

Int[(x_)^(m_.)*((a_) + (b_.)*(x_)^(n_))^(p_), x_Symbol] :> Int[x^(m + n*p)*(b + a/x^n)^p, x] /; FreeQ[{a, b, m
, n}, x] && IntegerQ[p] && NegQ[n]

Rule 2332

Int[Log[(c_.)*(x_)^(n_.)], x_Symbol] :> Simp[x*Log[c*x^n], x] - Simp[n*x, x] /; FreeQ[{c, n}, x]

Rule 2341

Int[((a_.) + Log[(c_.)*(x_)^(n_.)]*(b_.))*((d_.)*(x_))^(m_.), x_Symbol] :> Simp[(d*x)^(m + 1)*((a + b*Log[c*x^
n])/(d*(m + 1))), x] - Simp[b*n*((d*x)^(m + 1)/(d*(m + 1)^2)), x] /; FreeQ[{a, b, c, d, m, n}, x] && NeQ[m, -1
]

Rule 2354

Int[((a_.) + Log[(c_.)*(x_)^(n_.)]*(b_.))^(p_.)/((d_) + (e_.)*(x_)), x_Symbol] :> Simp[Log[1 + e*(x/d)]*((a +
b*Log[c*x^n])^p/e), x] - Dist[b*n*(p/e), Int[Log[1 + e*(x/d)]*((a + b*Log[c*x^n])^(p - 1)/x), x], x] /; FreeQ[
{a, b, c, d, e, n}, x] && IGtQ[p, 0]

Rule 2393

Int[((a_.) + Log[(c_.)*(x_)^(n_.)]*(b_.))*((f_.)*(x_))^(m_.)*((d_) + (e_.)*(x_)^(r_.))^(q_.), x_Symbol] :> Wit
h[{u = ExpandIntegrand[a + b*Log[c*x^n], (f*x)^m*(d + e*x^r)^q, x]}, Int[u, x] /; SumQ[u]] /; FreeQ[{a, b, c,
d, e, f, m, n, q, r}, x] && IntegerQ[q] && (GtQ[q, 0] || (IntegerQ[m] && IntegerQ[r]))

Rule 2438

Int[Log[(c_.)*((d_) + (e_.)*(x_)^(n_.))]/(x_), x_Symbol] :> Simp[-PolyLog[2, (-c)*e*x^n]/n, x] /; FreeQ[{c, d,
 e, n}, x] && EqQ[c*d, 1]

Rubi steps

\begin {align*} \int \frac {x^2 \left (a+b \log \left (c x^n\right )\right )}{d+\frac {e}{x}} \, dx &=\int \left (\frac {e^2 \left (a+b \log \left (c x^n\right )\right )}{d^3}-\frac {e x \left (a+b \log \left (c x^n\right )\right )}{d^2}+\frac {x^2 \left (a+b \log \left (c x^n\right )\right )}{d}-\frac {e^3 \left (a+b \log \left (c x^n\right )\right )}{d^3 (e+d x)}\right ) \, dx\\ &=\frac {\int x^2 \left (a+b \log \left (c x^n\right )\right ) \, dx}{d}-\frac {e \int x \left (a+b \log \left (c x^n\right )\right ) \, dx}{d^2}+\frac {e^2 \int \left (a+b \log \left (c x^n\right )\right ) \, dx}{d^3}-\frac {e^3 \int \frac {a+b \log \left (c x^n\right )}{e+d x} \, dx}{d^3}\\ &=\frac {a e^2 x}{d^3}+\frac {b e n x^2}{4 d^2}-\frac {b n x^3}{9 d}-\frac {e x^2 \left (a+b \log \left (c x^n\right )\right )}{2 d^2}+\frac {x^3 \left (a+b \log \left (c x^n\right )\right )}{3 d}-\frac {e^3 \left (a+b \log \left (c x^n\right )\right ) \log \left (1+\frac {d x}{e}\right )}{d^4}+\frac {\left (b e^2\right ) \int \log \left (c x^n\right ) \, dx}{d^3}+\frac {\left (b e^3 n\right ) \int \frac {\log \left (1+\frac {d x}{e}\right )}{x} \, dx}{d^4}\\ &=\frac {a e^2 x}{d^3}-\frac {b e^2 n x}{d^3}+\frac {b e n x^2}{4 d^2}-\frac {b n x^3}{9 d}+\frac {b e^2 x \log \left (c x^n\right )}{d^3}-\frac {e x^2 \left (a+b \log \left (c x^n\right )\right )}{2 d^2}+\frac {x^3 \left (a+b \log \left (c x^n\right )\right )}{3 d}-\frac {e^3 \left (a+b \log \left (c x^n\right )\right ) \log \left (1+\frac {d x}{e}\right )}{d^4}-\frac {b e^3 n \text {Li}_2\left (-\frac {d x}{e}\right )}{d^4}\\ \end {align*}

________________________________________________________________________________________

Mathematica [A]
time = 0.05, size = 142, normalized size = 0.96 \begin {gather*} \frac {36 a d e^2 x-36 b d e^2 n x-18 a d^2 e x^2+9 b d^2 e n x^2+12 a d^3 x^3-4 b d^3 n x^3-36 a e^3 \log \left (1+\frac {d x}{e}\right )+6 b \log \left (c x^n\right ) \left (d x \left (6 e^2-3 d e x+2 d^2 x^2\right )-6 e^3 \log \left (1+\frac {d x}{e}\right )\right )-36 b e^3 n \text {Li}_2\left (-\frac {d x}{e}\right )}{36 d^4} \end {gather*}

Antiderivative was successfully verified.

[In]

Integrate[(x^2*(a + b*Log[c*x^n]))/(d + e/x),x]

[Out]

(36*a*d*e^2*x - 36*b*d*e^2*n*x - 18*a*d^2*e*x^2 + 9*b*d^2*e*n*x^2 + 12*a*d^3*x^3 - 4*b*d^3*n*x^3 - 36*a*e^3*Lo
g[1 + (d*x)/e] + 6*b*Log[c*x^n]*(d*x*(6*e^2 - 3*d*e*x + 2*d^2*x^2) - 6*e^3*Log[1 + (d*x)/e]) - 36*b*e^3*n*Poly
Log[2, -((d*x)/e)])/(36*d^4)

________________________________________________________________________________________

Maple [C] Result contains higher order function than in optimal. Order 9 vs. order 4.
time = 0.06, size = 693, normalized size = 4.68

method result size
risch \(-\frac {a e \,x^{2}}{2 d^{2}}-\frac {a \,e^{3} \ln \left (d x +e \right )}{d^{4}}+\frac {b n \,e^{3} \dilog \left (-\frac {d x}{e}\right )}{d^{4}}+\frac {a \,x^{3}}{3 d}+\frac {b \ln \left (c \right ) x^{3}}{3 d}-\frac {49 b n \,e^{3}}{36 d^{4}}+\frac {b \ln \left (x^{n}\right ) x^{3}}{3 d}+\frac {b e n \,x^{2}}{4 d^{2}}-\frac {i b \pi \,\mathrm {csgn}\left (i c \right ) \mathrm {csgn}\left (i x^{n}\right ) \mathrm {csgn}\left (i c \,x^{n}\right ) x^{3}}{6 d}+\frac {i b \pi \,\mathrm {csgn}\left (i x^{n}\right ) \mathrm {csgn}\left (i c \,x^{n}\right )^{2} x \,e^{2}}{2 d^{3}}-\frac {i b \pi \,\mathrm {csgn}\left (i x^{n}\right ) \mathrm {csgn}\left (i c \,x^{n}\right )^{2} e^{3} \ln \left (d x +e \right )}{2 d^{4}}-\frac {i b \pi \,\mathrm {csgn}\left (i x^{n}\right ) \mathrm {csgn}\left (i c \,x^{n}\right )^{2} e \,x^{2}}{4 d^{2}}-\frac {i b \pi \,\mathrm {csgn}\left (i c \right ) \mathrm {csgn}\left (i c \,x^{n}\right )^{2} e^{3} \ln \left (d x +e \right )}{2 d^{4}}+\frac {i b \pi \,\mathrm {csgn}\left (i c \right ) \mathrm {csgn}\left (i c \,x^{n}\right )^{2} x \,e^{2}}{2 d^{3}}-\frac {i b \pi \,\mathrm {csgn}\left (i c \right ) \mathrm {csgn}\left (i c \,x^{n}\right )^{2} e \,x^{2}}{4 d^{2}}-\frac {b \,e^{2} n x}{d^{3}}+\frac {b n \,e^{3} \ln \left (d x +e \right ) \ln \left (-\frac {d x}{e}\right )}{d^{4}}-\frac {b \ln \left (x^{n}\right ) e \,x^{2}}{2 d^{2}}-\frac {i b \pi \,\mathrm {csgn}\left (i c \right ) \mathrm {csgn}\left (i x^{n}\right ) \mathrm {csgn}\left (i c \,x^{n}\right ) x \,e^{2}}{2 d^{3}}+\frac {b \ln \left (x^{n}\right ) x \,e^{2}}{d^{3}}-\frac {b \ln \left (x^{n}\right ) e^{3} \ln \left (d x +e \right )}{d^{4}}-\frac {i b \pi \mathrm {csgn}\left (i c \,x^{n}\right )^{3} x^{3}}{6 d}+\frac {b \ln \left (c \right ) x \,e^{2}}{d^{3}}-\frac {b \ln \left (c \right ) e^{3} \ln \left (d x +e \right )}{d^{4}}-\frac {b \ln \left (c \right ) e \,x^{2}}{2 d^{2}}+\frac {a \,e^{2} x}{d^{3}}+\frac {i b \pi \,\mathrm {csgn}\left (i c \right ) \mathrm {csgn}\left (i x^{n}\right ) \mathrm {csgn}\left (i c \,x^{n}\right ) e \,x^{2}}{4 d^{2}}-\frac {b n \,x^{3}}{9 d}+\frac {i b \pi \mathrm {csgn}\left (i c \,x^{n}\right )^{3} e \,x^{2}}{4 d^{2}}+\frac {i b \pi \,\mathrm {csgn}\left (i c \right ) \mathrm {csgn}\left (i c \,x^{n}\right )^{2} x^{3}}{6 d}+\frac {i b \pi \,\mathrm {csgn}\left (i x^{n}\right ) \mathrm {csgn}\left (i c \,x^{n}\right )^{2} x^{3}}{6 d}+\frac {i b \pi \mathrm {csgn}\left (i c \,x^{n}\right )^{3} e^{3} \ln \left (d x +e \right )}{2 d^{4}}-\frac {i b \pi \mathrm {csgn}\left (i c \,x^{n}\right )^{3} x \,e^{2}}{2 d^{3}}+\frac {i b \pi \,\mathrm {csgn}\left (i c \right ) \mathrm {csgn}\left (i x^{n}\right ) \mathrm {csgn}\left (i c \,x^{n}\right ) e^{3} \ln \left (d x +e \right )}{2 d^{4}}\) \(693\)

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(x^2*(a+b*ln(c*x^n))/(d+e/x),x,method=_RETURNVERBOSE)

[Out]

b*n*e^3/d^4*dilog(-d*x/e)-1/2*I*b*Pi*csgn(I*c)*csgn(I*x^n)*csgn(I*c*x^n)/d^3*x*e^2-1/2*a*e/d^2*x^2-a*e^3/d^4*l
n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________________________________

Maxima [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {Failed to integrate} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(x^2*(a+b*log(c*x^n))/(d+e/x),x, algorithm="maxima")

[Out]

1/6*a*((2*d^2*x^3 - 3*d*x^2*e + 6*x*e^2)/d^3 - 6*e^3*log(d*x + e)/d^4) + b*integrate((x^3*log(c) + x^3*log(x^n
))/(d*x + e), x)

________________________________________________________________________________________

Fricas [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {could not integrate} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(x^2*(a+b*log(c*x^n))/(d+e/x),x, algorithm="fricas")

[Out]

integral((b*x^3*log(c*x^n) + a*x^3)/(d*x + e), x)

________________________________________________________________________________________

Sympy [A]
time = 121.40, size = 267, normalized size = 1.80 \begin {gather*} \frac {a x^{3}}{3 d} - \frac {a e x^{2}}{2 d^{2}} - \frac {a e^{3} \left (\begin {cases} \frac {x}{e} & \text {for}\: d = 0 \\\frac {\log {\left (d x + e \right )}}{d} & \text {otherwise} \end {cases}\right )}{d^{3}} + \frac {a e^{2} x}{d^{3}} - \frac {b n x^{3}}{9 d} + \frac {b x^{3} \log {\left (c x^{n} \right )}}{3 d} + \frac {b e n x^{2}}{4 d^{2}} - \frac {b e x^{2} \log {\left (c x^{n} \right )}}{2 d^{2}} + \frac {b e^{3} n \left (\begin {cases} \frac {x}{e} & \text {for}\: d = 0 \\\frac {\begin {cases} - \operatorname {Li}_{2}\left (\frac {d x e^{i \pi }}{e}\right ) & \text {for}\: \frac {1}{\left |{x}\right |} < 1 \wedge \left |{x}\right | < 1 \\\log {\left (e \right )} \log {\left (x \right )} - \operatorname {Li}_{2}\left (\frac {d x e^{i \pi }}{e}\right ) & \text {for}\: \left |{x}\right | < 1 \\- \log {\left (e \right )} \log {\left (\frac {1}{x} \right )} - \operatorname {Li}_{2}\left (\frac {d x e^{i \pi }}{e}\right ) & \text {for}\: \frac {1}{\left |{x}\right |} < 1 \\- {G_{2, 2}^{2, 0}\left (\begin {matrix} & 1, 1 \\0, 0 & \end {matrix} \middle | {x} \right )} \log {\left (e \right )} + {G_{2, 2}^{0, 2}\left (\begin {matrix} 1, 1 & \\ & 0, 0 \end {matrix} \middle | {x} \right )} \log {\left (e \right )} - \operatorname {Li}_{2}\left (\frac {d x e^{i \pi }}{e}\right ) & \text {otherwise} \end {cases}}{d} & \text {otherwise} \end {cases}\right )}{d^{3}} - \frac {b e^{3} \left (\begin {cases} \frac {x}{e} & \text {for}\: d = 0 \\\frac {\log {\left (d x + e \right )}}{d} & \text {otherwise} \end {cases}\right ) \log {\left (c x^{n} \right )}}{d^{3}} - \frac {b e^{2} n x}{d^{3}} + \frac {b e^{2} x \log {\left (c x^{n} \right )}}{d^{3}} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(x**2*(a+b*ln(c*x**n))/(d+e/x),x)

[Out]

a*x**3/(3*d) - a*e*x**2/(2*d**2) - a*e**3*Piecewise((x/e, Eq(d, 0)), (log(d*x + e)/d, True))/d**3 + a*e**2*x/d
**3 - b*n*x**3/(9*d) + b*x**3*log(c*x**n)/(3*d) + b*e*n*x**2/(4*d**2) - b*e*x**2*log(c*x**n)/(2*d**2) + b*e**3
*n*Piecewise((x/e, Eq(d, 0)), (Piecewise((-polylog(2, d*x*exp_polar(I*pi)/e), (Abs(x) < 1) & (1/Abs(x) < 1)),
(log(e)*log(x) - polylog(2, d*x*exp_polar(I*pi)/e), Abs(x) < 1), (-log(e)*log(1/x) - polylog(2, d*x*exp_polar(
I*pi)/e), 1/Abs(x) < 1), (-meijerg(((), (1, 1)), ((0, 0), ()), x)*log(e) + meijerg(((1, 1), ()), ((), (0, 0)),
 x)*log(e) - polylog(2, d*x*exp_polar(I*pi)/e), True))/d, True))/d**3 - b*e**3*Piecewise((x/e, Eq(d, 0)), (log
(d*x + e)/d, True))*log(c*x**n)/d**3 - b*e**2*n*x/d**3 + b*e**2*x*log(c*x**n)/d**3

________________________________________________________________________________________

Giac [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {could not integrate} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(x^2*(a+b*log(c*x^n))/(d+e/x),x, algorithm="giac")

[Out]

integrate((b*log(c*x^n) + a)*x^2/(d + e/x), x)

________________________________________________________________________________________

Mupad [F]
time = 0.00, size = -1, normalized size = -0.01 \begin {gather*} \int \frac {x^2\,\left (a+b\,\ln \left (c\,x^n\right )\right )}{d+\frac {e}{x}} \,d x \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((x^2*(a + b*log(c*x^n)))/(d + e/x),x)

[Out]

int((x^2*(a + b*log(c*x^n)))/(d + e/x), x)

________________________________________________________________________________________